<template>
  <div class='tag-input'>
    <div v-for='(tag, index) in tags' :key='tag.userId' class='tag-input__tag'>
      {{ tag.userName }}
      <span  @click='removeTag(index)'>x</span>
    </div>
  </div>
</template>
<script>
export default {
  props:['tags'],
  data () {
    return {
    }
  },
  methods: {
    removeTag (index) {
      this.tags.splice(index, 1)
    }
  }
}
</script>
<style scoped>
.tag-input {
  width: 100%;
  border: 1px solid #eee;
  font-size: 0.9em;
  height: 100px;
  box-sizing: border-box;
  padding: 0 10px;
  overflow-y: auto;
}

.tag-input__tag {
  height: 30px;
  float: left;
  margin-right: 10px;
  background-color: #eee;
  margin-top: 10px;
  line-height: 30px;
  padding: 0 5px;
  border-radius: 5px;
}

.tag-input__tag > span {
  cursor: pointer;
  opacity: 0.75;
}

.tag-input__text {
  border: none;
  outline: none;
  font-size: 0.9em;
  line-height: 50px;
  background: none;
}
</style>
